<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'centerimg.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<style type="text/css">
	body{
		margin:0px 0px;
		padding:0px 0px;
		width: 100%;
		height: 100%;
		background-color: #eee8aa;
	}
</style>
<script type="text/javascript">
	function shanchu(id){
  		var r = confirm("确定删除吗");
		if(r==true){
			var path=$("#path"+id).val();
			window.location.href="${pageContext.request.contextPath }/Guan/GuanLiCenter_deleteMoRenImg.action?path="+path;
		}
		return false;
  	}
  	
  	function updateSub(){
  		var file = $("#up_file").val();
  		if(file!=""){
  			return true;
  		}
  		alert("文件不能为空!");
  	 	return false;
  	}
  	
  	function insertSub(){
  		var file = $("#in_file").val();
  		if(file!=""){
  			return true;
  		}
  		alert("文件不能为空!");
  	 	return false;
  	}
  	
  	
</script>
  <script type="text/javascript" src="./js/jquery-1.8.2.js"></script></head>
  <body>
      <p style="margin-top: 10px">可点击选择图片按钮修改:
  	<div class="top" style="padding-left: 50px">
	  	<c:forEach items="${imgList}" var="r2" varStatus="v">
	  		${v.index+1}.
	  		<img alt="首页" src="/wifiIMG/img/uersImg/picturesImg/MoRenUserImg/${r2}" height="50%" >
	  		<form action="${pageContext.request.contextPath}/Guan/GuanLiCenter_updateMoRenImg.action" method="post" 
	  			enctype="multipart/form-data" onsubmit="return updateSub()">
	  			<input type="hidden" name="path" id="patha${v.index}"  value="${r2}"> 
			  	<input type="file" name="file" style="margin-left: 30px;border: solid 1px #8fbc8f;" id="up_file"/>
			  	<input type="submit" value="保   存" style="padding-left: 25px;padding-right: 25px;">
			  	<input type="button" value="删除" title="点击删除" onclick="return shanchu(this.id)" id="a${v.index}"/>
		  	</form>
	  	</c:forEach>
	  	<hr>
	  	<p style="font-weight: 800" >添加:</p>
	  	<form action="${pageContext.request.contextPath}/Guan/GuanLiCenter_addMoRenImg.action" method="post" enctype="multipart/form-data" onsubmit="return insertSub()">
		  	<input type="file" name="file" style="margin-left: 30px;border: solid 1px #8fbc8f;" id="in_file"/>
	  		<input type="submit" value="添  加" style="padding-left: 25px;padding-right: 25px;" >
	  	</form>
	  	<br>
	  	<br>
  	</div>
  </body>
  
  
</html>
